package player;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

import interfaces.IPlayer;

public class Player implements IPlayer {
	String name;
	
	
	public Player(String name)  {
		this.name = name;
		
	}


	//defines what the player does/can do during his turn
	@Override
	public int turn() {
		int sticksToRemove = readFromConsole(); 
		
		return sticksToRemove;
	}

	//returns the input from the console
	public int readFromConsole() {
		BufferedReader console = new BufferedReader(new InputStreamReader(System.in));
		String input = null;
		try {
			input = console.readLine();
		} catch (IOException e) {
			e.printStackTrace();
		}
		
		return Integer.valueOf(input);	
	}

	@Override
	public void printMessage(String message) {
		System.out.println(message);
		
	}


	public String getName() {
		return name;
	}

}
